<%@ taglib prefix="s" uri="/struts-tags" %>
<!DOCTYPE HTML>
<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8"%>
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<!--[if lt IE 9]>
<script type="text/javascript" src="/lib/html5.js"></script>
<script type="text/javascript" src="/lib/respond.min.js"></script>
<script type="text/javascript" src="/lib/PIE_IE678.js"></script>
<![endif]-->
<link href="/css/H-ui.min.css" rel="stylesheet" type="text/css" />
<link href="/css/H-ui.admin.css" rel="stylesheet" type="text/css" />
<link href="/lib/Hui-iconfont/1.0.6/iconfont.css" rel="stylesheet" type="text/css" />
<!--[if IE 6]>
<script type="text/javascript" src="http://lib.h-ui.net/DD_belatedPNG_0.0.8a-min.js" ></script>
<script>DD_belatedPNG.fix('*');</script>
<![endif]-->
<title>3D柱状图</title>
</head>
<body>
<nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页 <span class="c-gray en">&gt;</span> 统计管理 <span class="c-gray en">&gt;</span> 3D柱状图 <a class="btn btn-success radius r mr-20" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新" ><i class="Hui-iconfont">&#xe68f;</i></a></nav>
<div class="pd-20">
	<div id="container" style="min-width:700px;height:400px"></div>
</div>
<script type="text/javascript" src="/lib/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript" src="/lib/layer/2.1/layer.js"></script>
<script type="text/javascript" src="/js/H-ui.js"></script>
<script type="text/javascript" src="/js/H-ui.admin.js"></script>
<script type="text/javascript" src="/lib/Highcharts/4.1.7/js/highcharts.js"></script>
<script type="text/javascript" src="/lib/Highcharts/4.1.7/js/modules/exporting.js"></script>
<script type="text/javascript" src="/lib/Highcharts/4.1.7/js/highcharts-3d.js"></script>
<body>
<s:iterator value="count.keySet()" id="key">
            <input type="hidden"  name="count" value="${count.get[key]}"/>
</s:iterator>


<s:iterator value="count.keySet()" id="key">
    <input type="hidden"  name="data_name" value="${key}"/>
</s:iterator>

</body>
<script type="text/javascript">

﻿$(function () {
    // Set up the chart
    var dataArry = [];

    var countE = document.getElementsByName("count");
    for(var i = 0;i<countE.length;i++)
    {

        dataArry.push(parseInt(countE[i].value))
    }

    var chart = new Highcharts.Chart({
        chart: {
            renderTo: 'container',
            type: 'column',
            margin: 75,
            options3d: {
                enabled: false,
                alpha: 15,
                beta: 15,
                depth: 50,
                viewDistance: 25
            }
        },
        title: {
            text: '系统数据容量分布图'
        },
        subtitle: {
            text: '系统数据分布图'
        },
        plotOptions: {
            column: {
                depth: 25
            }
        },
        series: [{
            data: dataArry
        }]
    });
    showValues();
    changeText();

    // Activate the sliders
    $('#R0').on('change', function(){
        chart.options.chart.options3d.alpha = this.value;
        showValues();
        chart.redraw(false);
        changeText();
    });
    $('#R1').on('change', function(){
        chart.options.chart.options3d.beta = this.value;
        showValues();
        chart.redraw(false);
    });

    function showValues() {
        $('#R0-value').html(chart.options.chart.options3d.alpha);
        $('#R1-value').html(chart.options.chart.options3d.beta);
        changeText();
    }
    function changeText()
    {
        var nameArray = document.getElementsByName("data_name");
        var text = document.getElementsByTagName("text");
        var index = 0;
        for(var i = 0;i< text.length;i++)
        {
            var content = text[i].innerHTML;
            if(!isNaN(content)&&content<11&&content>=0&&content!="")
            {
                text[i].innerHTML = nameArray[index].value;
                index++;
            }
        }
    }

});
</script>
</body>
</html>